%option noyywrap
%{

#include "stdio.h"
#include "stdlib.h"
#include "math.h"
int noi = 0;
double pre[64] = {0.0};
int do_num = 0;
int i = 0,k;
double temp = 0.0;
%}
ID ^[0-9]{9}
NAME NAME$
NUM [1-9][0-9]*[.][0-9]*
INT [1-9][0-9]*
SPACE [ \t\n]

%%

{ID} {
	if(quchong() == 0)
		pre[i++] = atof(yytext);
	printf("201492475");
	if(do_num)
		noi++;}
{NAME} {printf("PL");}
{NUM}  {
	if(quchong() == 0)
		pre[i++] = temp;
	temp = round(2*temp+201492475);
	printf("%.0lf ",temp);
	//printf("\n%d\n",noi);
	do_num = 1;
	}

{INT} {
	if(do_num)
		noi++;
	if(quchong()==0)
		pre[i++]=atof(yytext);
	temp=round(2*temp+201492475);
	printf("%.01f",temp);
	do_num=1;
	}

{SPACE} {printf("%s",yytext);}
%%
int main()
{
	yylex();
	printf("出现次数%d\t去重后次数%d\n",noi,i);
	return 0;
}

int quchong()
{
	int j;
	temp = atof(yytext);		
	if(i == 0)
		return 0;
	for(j = 0 ; j < i ; j++)
	{
		if(fabs(pre[j] - atof(yytext)) < 1e-6)
			return 1;
	}
	return 0;
}
